<?php

namespace common\models\credit_app_tables;

use Yii;

/**
 * This is the model class for table "{{%mobile_save_video}}".
 *
 * @property int $id
 * @property string $order_id
 * @property string $idno
 * @property string $url
 * @property string $path
 * @property int $created_at
 */
class MobileSaveVideo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%mobile_save_video}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_app');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['order_id', 'idno', 'created_at'], 'required'],
            [['created_at'], 'integer'],
            [['order_id', 'idno'], 'string', 'max' => 20],
            [['url', 'path'], 'string', 'max' => 255],
            [['idno', 'url', 'path'], 'unique', 'targetAttribute' => ['idno', 'url', 'path']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'order_id' => Yii::t('app', 'Order ID'),
            'idno' => Yii::t('app', 'Idno'),
            'url' => Yii::t('app', 'Url'),
            'path' => Yii::t('app', 'Path'),
            'created_at' => Yii::t('app', 'Created At'),
        ];
    }
}
